/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.put.netbeans.dcs_modeler.dataObjects;

import java.io.IOException;
import org.openide.filesystems.FileObject;
import org.openide.loaders.DataObjectExistsException;
import org.openide.loaders.MultiDataObject;
import org.openide.nodes.CookieSet;
import org.openide.nodes.Node;
import org.openide.util.Lookup;
import org.put.netbeans.dcs_modeler.actions.DCSModelerOpenSuport;

public class DCSModelDefinitionDataObject extends MultiDataObject
{

    public DCSModelDefinitionDataObject( FileObject pf, DCSModelDefinitionDataLoader loader ) throws DataObjectExistsException, IOException
    {
        super( pf, loader );
        CookieSet cookies = getCookieSet();
        //cookies.add( ( Node.Cookie ) DataEditorSupport.create( this, getPrimaryEntry(), cookies ) );
        cookies.add( ( Node.Cookie )new DCSModelerOpenSuport( getPrimaryEntry() ) );
    }

    @Override
    protected Node createNodeDelegate()
    {
        return new DCSModelDefinitionDataNode( this, getLookup() );
    }

    @Override
    public Lookup getLookup()
    {
        return getCookieSet().getLookup();
    }
}
